#include "head.h"
/* Usage: */

bool my_rm(sendMsg msg, client_status* user, int net_fd){
    printf("这是服务端rm命令分支！\n");
    char tpath[2048] = {0};
    recvMsg rmsg;
    getpath(tpath, user, msg.msg);
    printf("tpath = %s\n", tpath);
    int fd = open(tpath, O_RDWR);
    
    if(fd==-1){
        strcpy(rmsg.statu, "-1");
        strcpy(rmsg.msg, "文件不存在！");
        send(net_fd, &rmsg, sizeof(rmsg), 0);
        return false;
    }
    unlink(tpath);
    strcpy(rmsg.statu, "0");
    strcpy(rmsg.msg, "成功删除!");
    send(net_fd, &rmsg, sizeof(rmsg), 0);
    return true;
}
